from flask import Blueprint, request
from ..Service.user_s import UserService
from lib.util.crypto import JWT

user = Blueprint('user',__name__)
__us = UserService()

@user.route('/regist', methods=['POST'])
def regist():
    return __us.regist(**request.get_json())
@user.route('/login', methods=['POST'])
def login():
    return __us.login(**request.get_json())
@user.route('/set/logo', methods=['POST'])
@JWT.auth.login_required
def set_logo():
    return __us.set_logo(request.form.to_dict(), request.files)
@user.route('/get/logo', methods=['GET'])
@JWT.auth.login_required
def get_logo():
    return __us.get_logo(**request.args.to_dict())